package com.uzai.common.enums.mini;

import java.util.Objects;

/**
 * The enum Mini order status.
 *
 * @author mingyang.chen create in 2023/11/1 17:09
 */
public enum MiniOrderServiceType {

    /**
     * 仅退款
     */
    REFUND(1, "退款"),
    /**
     * 退货退款
     */
    REFUND_GOODS(2,"退货退款"),
    /**
     * 换货
     */
    REPLACE(3,"换货"),
    ;

    private Integer code;
    private String desc;

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    MiniOrderServiceType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MiniOrderServiceType getByCode(Integer code) {
        for (MiniOrderServiceType value : MiniOrderServiceType.values()) {
            if (Objects.equals(value.code, code)) {
                return value;
            }
        }
        return null;
    }

    /**
     * Gets code.
     *
     * @return the code
     */
    public Integer getCode() {
        return code;
    }
}
